import path from 'path';
// import data from "./assets/test";
import data from './assets/zh';
import {checkAccess, jsonToExcel, excelToJson} from './utils/tools';

const dirPath = path.resolve('public'); // 文件夹名称
const entryPath = path.resolve('src/assets/it.xlsx'); // 输入文件路径
const outputPath = path.resolve('public/it.js'); // 输出文件路径

async function run() {
  const check = await checkAccess(dirPath);
  if (check) {
    // json 转 excel
    // jsonToExcel(data);
    // excel 转 json
    excelToJson(entryPath, outputPath);
  }
}

run();
